﻿/*********************************************************************************
**                                                                              **
**  Copyright (C) 2022-2022 LiLong                                              **
**  This file is part of BluetoothCpp.                                          **
**                                                                              **
**  BluetoothCpp is free software: you can redistribute it and/or modify        **
**  it under the terms of the GNU Lesser General Public License as published by **
**  the Free Software Foundation, either version 3 of the License, or           **
**  (at your option) any later version.                                         **
**                                                                              **
**  BluetoothCpp is distributed in the hope that it will be useful,             **
**  but WITHOUT ANY WARRANTY; without even the implied warranty of              **
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               **
**  GNU Lesser General Public License for more details.                         **
**                                                                              **
**  You should have received a copy of the GNU Lesser General Public License    **
**  along with BluetoothCpp.  If not, see <https://www.gnu.org/licenses/>.      **
**********************************************************************************/
#include <BluetoothCpp/Device.h>
#include <BluetoothCpp/Instance.h>

#include <iostream>

int main(int argc, char* argv[])
{
    BTH::Instance inst;
    const auto& devices = BTH::Device::findDevices();

    for (const auto& device : devices)
    {
        std::cout << "Name:                 " << device.name() << std::endl;
        std::cout << "Address:              " << device.address().toString() << std::endl;
        std::cout << "Connected:            " << std::boolalpha << device.isConnected() << std::endl;
        std::cout << "Authenticated:        " << std::boolalpha << device.isAuthenticated() << std::endl;
        std::cout << "Remembered:           " << std::boolalpha << device.isRemembered() << std::endl;
        std::cout << "Last Seen:            " << device.lastSeenTime() << std::endl;
        std::cout << "Last Used:            " << device.lastUsedTime() << std::endl;
        std::cout << "Major Device Class:   " << device.majorDeviceClass() << std::endl;
        std::cout << std::endl;
    }
}
